//
//  CZNavBarItem.m
//  CZOC微博01
//
//  Created by 1 on 15/11/28.
//  Copyright © 2015年 itcast. All rights reserved.
//

#import "CZNavBarItem.h"

@implementation CZNavBarItem
+ (UIBarButtonItem *)itemWithTarget:(id)target action:(SEL)actiion image:(NSString *)image hightImage:(NSString *)hightImage
{
    UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
    
    [btn addTarget:target action:actiion forControlEvents:UIControlEventTouchUpInside];
    
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:hightImage] forState:UIControlStateHighlighted];
    
    btn.size=btn.currentBackgroundImage.size;
    return [[UIBarButtonItem alloc] initWithCustomView:btn];
}
@end
